<!DOCTYPE html>
<html>
<head>
<title>会员管理</title>
#include("../include/common.html")
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>会员管理</h5>
            </div>
            <form id="listForm" action="balance" method="get">
            	<input type="hidden" name="memberId" id="memberId" value="#(memberId)">
                <div class="ibox-content">
                    <!-- 搜索 start -->
                    <!-- 搜索 end -->
                    <!-- 列表 start -->
                    <div class="form-horizontal clear">
                        <div class="form-group">
                            <div class="col-sm-8">
                            	<a class="btn btn-primary" href="javascript:;" id="addBalance">增加余额</a>
                            	<a class="btn btn-primary" href="javascript:;" id="reduceBalance">减少余额</a>
                            	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <a href="javascript:;" class="btn btn-primary" id="refreshButton"><i class="fa fa-refresh"></i> 刷新</a>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            	<a href="#(base)/admin/member/list" class="btn btn-primary"><i class="fa fa-arrow-left"></i> 返回</a>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table class="table table-bordered" id="listTable">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>类型</th>
                                        <th>收支</th>
                                        <th>金额</th>
                                        <th>创建日期</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    #for(payment : page.list)
                                    <tr>
                                        <td>#(payment.id)</td>
                                        <td>#if(payment.type==1) 购买商品 #else if(payment.type==2) 充值 #else if(payment.type==3) 提现  #else if(payment.type==4) 退款 #else if(payment.type==5) 分销佣金 #else if(payment.type==6) 微店分成  #else if(payment.type==7) 平台操作#end</td>
                                        <td>#(payment.inout)</td>
                                        <td>#(payment.amount)</td>
                                        <td>#date(payment.createDate,"yyyy-MM-dd")</td>
                                    </tr>
                                    #end
                                </tbody>
                            </table>
                        </div>
                        <div class="text-center">
                            #pagination(pageNumber = page.pageNumber,totalPages = page.totalPage,pattern = "")
                                #include("../include/pagination.html")
                            #end
                        </div>
                    </div>
                    <!-- 列表 end -->
                </div>
            </form>
        </div>
    </div>
    
    
             <!-- model -->
  <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModel" class="modal fade">
  <div class="modal-dialog" role="document">
  <div class="modal-content">
  </div>
  </div>
  </div>
    
</body>
</html>
<script type="text/javascript">

$("#addBalance").click(function(){
		var memberId = $("#memberId").val();
		var type ="add";
        $('#myModel').modal({ remote: "#(base)/admin/member/editBalance?memberId="+memberId+"&type="+type });
    });
    
    
$("#reduceBalance").click(function(){
	var memberId = $("#memberId").val();
	var type ="reduce";
    $('#myModel').modal({ remote: "#(base)/admin/member/editBalance?memberId="+memberId+"&type="+type });
});

    
    
    $("#myModel").on("hidden.bs.modal", function() {
        $(this).removeData("bs.modal");
    });
</script>